package com.seres.feign.validator.validator;

import com.seres.feign.validator.annotation.NotBlank;
import com.seres.util.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Description : 不能为空校验器
 * @ClassName : NotEmptyValidator
 * @Author : 程磊
 * @Date: 2020-07-06 16:55
 */
public class NotBlankValidator implements ConstraintValidator<NotBlank, String> {
    @Override
    public void initialize(NotBlank constraintAnnotation) {

    }

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return StringUtils.isNotBlank(s);
    }
}
